dic_dummy = {}
for col in qualitativecol:
data = pd.concat([dfTrain['SalePrice'], dfTrain[col]], axis=1)
dic_tmp =data.groupby(col).mean().to_dict()
dic_tmp[col] = dic_tmp.pop('SalePrice')
dic_dummy.update(dic_tmp)
all_data.replace(dic_dummy, inplace=True)
all_data.head()